﻿using System.Web.Mvc;
using Morus.Infrastructure;

namespace KAKA.Infrastructure
{
    public class RegisterFilters : IBootstrapperTask
    {
        private GlobalFilterCollection _filters;

        public RegisterFilters(GlobalFilterCollection filters)
        {
            _filters = filters;
        }

        public RegisterFilters()
            : this(GlobalFilters.Filters)
        {
        }

        public void Execute()
        {
            _filters.Add(new HandleErrorAttribute());
            _filters.Add(new CurrentUserAttribute() { Order = 1 });
            _filters.Add(new NicknameAttribute());
            _filters.Add(new SiteAttribute());
        }
    }
}